const InjectBuildTime = () => {
  return {
    name: 'vite-plugin-inject-build-time',
    transformIndexHtml(html: string) {
      const now = new Date().toLocaleString()
      return html.replace(
        '<body>',
        `<body><!-- last build time ${now} -->`
      )
    }
  }
}

export default InjectBuildTime
